import pygame
import time

from eboard import Board

pygame.init()

WIDTH = 800
HEIGHT = 800
PADDING = 40

GRID_WIDTH = (WIDTH - PADDING * 2) // 8
GRID_HEIGHT = (HEIGHT - PADDING * 2) // 8

screen = pygame.display.set_mode((WIDTH, HEIGHT))

screen.fill((192, 192, 192))
for i in range(9):
    pygame.draw.line(screen, (0, 0, 0),
        (PADDING, PADDING + i * GRID_HEIGHT),
        (WIDTH - PADDING, PADDING + i * GRID_HEIGHT))

for i in range(9):
    pygame.draw.line(screen, (0, 0, 0),
        (PADDING + i * GRID_WIDTH, PADDING),
        (PADDING + i * GRID_WIDTH, HEIGHT - PADDING))

board = Board(screen)
board.draw()

pygame.display.update()

going = True

while going:
    for evt in pygame.event.get():
        if evt.type == pygame.QUIT:
            going = False

    time.sleep(0.03)
